<template>
	<view>
		<view class="head pd-46 white">
			<view class="size-36 bold">{{data.status == 1 ? '待发货' : data.status == 2 ? '已发货' : '已签收'}}</view>
			<view class="size-24 mt-18">{{data.status == 1 ? '商品已下单 等待卖家发货' : data.status == 2 ? '卖家已发货 等待买家收款' : '买家已签收 订单已完成'}}</view>
		</view>
		<view class="box flex_l pd-20" style="margin-top: -90rpx;">
			<image class="active" :src="data.doctor_avatar" mode=""></image>
			<view class="flex-wrap">
				<view class="duohang size-28" style="width: 386rpx;">{{data.medicine_name}}</view>
				<view class="size-24 bold mt-80" style="color: #FF5F32;">￥{{data.medicine_price}}</view>
			</view>
		</view>
		<view class="size-28 bold mt-30 ml-30">药品详情</view>
		<view class="box size-24" style="line-height: 38rpx;">
			{{data.medicine_remark}}
		</view>
		<view class="size-28 bold mt-30 ml-30">订单详情</view>
		<view class="box size-24" style="line-height: 38rpx;">
			<view class="flex">
				<view class="size-28">订单编号</view>
				<view class="size-28" style="color: #999;">{{data.order_sn}}</view>
			</view>
			<view class="flex mt-20">
				<view class="size-28">创建时间</view>
				<view class="size-28" style="color: #999;">{{data.create_time}}</view>
			</view>
			<view class="flex mt-20">
				<view class="size-28">付款时间</view>
				<view class="size-28" style="color: #999;">{{data.pay_time}}</view>
			</view>
		</view>
		<view class="box size-24" style="line-height: 38rpx;">
			<view class="flex mt-20">
				<view class="size-28">快递单号</view>
				<view class="size-28">{{data.deliver_code}}</view>
			</view>
			<view class="flex">
				<view class="size-28">收货人名称</view>
				<view class="size-28">{{data.patient_name}}</view>
			</view>
			<view class="flex mt-20">
				<view class="size-28">收货人手机号</view>
				<view class="size-28">{{data.patient_mobile}}</view>
			</view>
			<view class="flex mt-20">
				<view class="size-28">收货人地址</view>
				<view class="size-28" style="width: 384rpx;text-align: right;">{{data.patient_address}}</view>
			</view>
		</view>
		<view style="height: 280rpx;"></view>
		<view class="footer flex">
			<view></view>
			<view class="center">
				<view class="btn" @click="navto">查看物流</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				id: '',
				data: {}
			};
		},
		onLoad(op) {
			this.id = op.id
			this.detail()
		},
		methods: {
			detail() {
				this.$api.orderDetail({
					order_id: this.id
				}).then(res => {
					this.data = res.data
				})
			},
			navto() {
				uni.navigateTo({
					url: '../logistics/logistics?id=' + this.data.order_id
				})
			}
		}
	}
</script>

<style lang="scss">
	page {
		background-color: #f8f8f8;
	}

	.footer {
		width: 750rpx;
		height: 100rpx;
		background: #FFFFFF;
		box-shadow: 0rpx -6rpx 8rpx 2rpx rgba(204, 204, 204, 0.11);
		border-radius: 0rpx 0rpx 0rpx 0rpx;
		opacity: 1;
		position: fixed;
		bottom: 0;
		left: 0;
		padding: 20rpx 30rpx;
	}

	.btn {
		width: 154rpx;
		height: 60rpx;
		line-height: 60rpx;
	}

	.btna {
		width: 154rpx;
		height: 60rpx;
		line-height: 60rpx;
		margin-right: 30rpx;
	}

	.head {
		width: 100%;
		height: 288rpx;
		background: #882027;
		border-radius: 0rpx 0rpx 0rpx 0rpx;
		opacity: 1;
	}

	.box {
		width: 690rpx;
		background: #FFFFFF;
		border-radius: 20rpx 20rpx 20rpx 20rpx;
		opacity: 1;
		margin: 30rpx auto 0;
		padding: 30rpx;
	}

	.active {
		width: 200rpx;
		height: 200rpx;
		margin-right: 20rpx;
		border-radius: 30rpx;
		background-color: pink;
	}
</style>
